<?php

$countryCodeMap = [
    'AD' => ['en_name' => 'Andorra', 'name' => '安道尔'],
    'AE' => ['en_name' => 'United Arab Emirates', 'name' => '阿联酋'],
    'AF' => ['en_name' => 'Afghanistan', 'name' => '阿富汗'],
    'AG' => ['en_name' => 'Antigua and Barbuda', 'name' => '安提瓜和巴布达'],
    'AI' => ['en_name' => 'Anguilla', 'name' => '安圭拉'],
    'AL' => ['en_name' => 'Albania', 'name' => '阿尔巴尼亚'],
    'AM' => ['en_name' => 'Armenia', 'name' => '亚美尼亚'],
    'AO' => ['en_name' => 'Angola', 'name' => '安哥拉'],
    'AQ' => ['en_name' => 'Antarctica', 'name' => '南极洲'],
    'AR' => ['en_name' => 'Argentina', 'name' => '阿根廷'],
    'AS' => ['en_name' => 'American Samoa', 'name' => '美属萨摩亚'],
    'AT' => ['en_name' => 'Austria', 'name' => '奥地利'],
    'AU' => ['en_name' => 'Australia', 'name' => '澳大利亚'],
    'AW' => ['en_name' => 'Aruba', 'name' => '阿鲁巴'],
    'AX' => ['en_name' => 'Åland Islands', 'name' => '奥兰'],
    'AZ' => ['en_name' => 'Azerbaijan', 'name' => '阿塞拜疆'],
    'BA' => ['en_name' => 'Bosnia and Herzegovina', 'name' => '波黑'],
    'BB' => ['en_name' => 'Barbados', 'name' => '巴巴多斯'],
    'BD' => ['en_name' => 'Bangladesh', 'name' => '孟加拉国'],
    'BE' => ['en_name' => 'Belgium', 'name' => '比利时'],
    'BF' => ['en_name' => 'Burkina Faso', 'name' => '布基纳法索'],
    'BG' => ['en_name' => 'Bulgaria', 'name' => '保加利亚'],
    'BH' => ['en_name' => 'Bahrain', 'name' => '巴林'],
    'BI' => ['en_name' => 'Burundi', 'name' => '布隆迪'],
    'BJ' => ['en_name' => 'Benin', 'name' => '贝宁'],
    'BL' => ['en_name' => 'Saint Barthélemy', 'name' => '圣巴泰勒米'],
    'BM' => ['en_name' => 'Bermuda', 'name' => '百慕大'],
    'BN' => ['en_name' => 'Brunei Darussalam', 'name' => '文莱'],
    'BO' => ['en_name' => 'Bolivia, Plurinational State of', 'name' => '玻利维亚'],
    'BQ' => ['en_name' => 'Bonaire, Sint Eustatius and Saba', 'name' => '荷兰加勒比区'],
    'BR' => ['en_name' => 'Brazil', 'name' => '巴西'],
    'BS' => ['en_name' => 'Bahamas', 'name' => '巴哈马'],
    'BT' => ['en_name' => 'Bhutan', 'name' => '不丹'],
    'BV' => ['en_name' => 'Bouvet Island', 'name' => '布韦岛'],
    'BW' => ['en_name' => 'Botswana', 'name' => '博茨瓦纳'],
    'BY' => ['en_name' => 'Belarus', 'name' => '白俄罗斯'],
    'BZ' => ['en_name' => 'Belize', 'name' => '伯利兹'],
    'CA' => ['en_name' => 'Canada', 'name' => '加拿大'],
    'CC' => ['en_name' => 'Cocos (Keeling) Islands', 'name' => '科科斯（基林）群岛'],
    'CD' => ['en_name' => 'Congo, the Democratic Republic of the', 'name' => '刚果民主共和国'],
    'CF' => ['en_name' => 'Central African Republic', 'name' => '中非'],
    'CG' => ['en_name' => 'Congo', 'name' => '刚果共和国'],
    'CH' => ['en_name' => 'Switzerland', 'name' => '瑞士'],
    'CI' => ['en_name' => 'Côte d\'Ivoire', 'name' => '科特迪瓦'],
    'CK' => ['en_name' => 'Cook Islands', 'name' => '库克群岛'],
    'CL' => ['en_name' => 'Chile', 'name' => '智利'],
    'CM' => ['en_name' => 'Cameroon', 'name' => '喀麦隆'],
    'CN' => ['en_name' => 'China', 'name' => '中国'],
    'CO' => ['en_name' => 'Colombia', 'name' => '哥伦比亚'],
    'CR' => ['en_name' => 'Costa Rica', 'name' => '哥斯达黎加'],
    'CU' => ['en_name' => 'Cuba', 'name' => '古巴'],
    'CV' => ['en_name' => 'Cabo Verde', 'name' => '佛得角'],
    'CW' => ['en_name' => 'Curaçao', 'name' => '库拉索'],
    'CX' => ['en_name' => 'Christmas Island', 'name' => '圣诞岛'],
    'CY' => ['en_name' => 'Cyprus', 'name' => '塞浦路斯'],
    'CZ' => ['en_name' => 'Czechia', 'name' => '捷克'],
    'DE' => ['en_name' => 'Germany', 'name' => '德国'],
    'DJ' => ['en_name' => 'Djibouti', 'name' => '吉布提'],
    'DK' => ['en_name' => 'Denmark', 'name' => '丹麦'],
    'DM' => ['en_name' => 'Dominica', 'name' => '多米尼克'],
    'DO' => ['en_name' => 'Dominican Republic', 'name' => '多米尼加'],
    'DZ' => ['en_name' => 'Algeria', 'name' => '阿尔及利亚'],
    'EC' => ['en_name' => 'Ecuador', 'name' => '厄瓜多尔'],
    'EE' => ['en_name' => 'Estonia', 'name' => '爱沙尼亚'],
    'EG' => ['en_name' => 'Egypt', 'name' => '埃及'],
    'EH' => ['en_name' => 'Western Sahara', 'name' => '西撒哈拉'],
    'ER' => ['en_name' => 'Eritrea', 'name' => '厄立特里亚'],
    'ES' => ['en_name' => 'Spain', 'name' => '西班牙'],
    'ET' => ['en_name' => 'Ethiopia', 'name' => '埃塞俄比亚'],
    'FI' => ['en_name' => 'Finland', 'name' => '芬兰'],
    'FJ' => ['en_name' => 'Fiji', 'name' => '斐济'],
    'FK' => ['en_name' => 'Falkland Islands (Malvinas)', 'name' => '福克兰群岛'],
    'FM' => ['en_name' => 'Micronesia, Federated States of', 'name' => '密克罗尼西亚联邦'],
    'FO' => ['en_name' => 'Faroe Islands', 'name' => '法罗群岛'],
    'FR' => ['en_name' => 'France', 'name' => '法国'],
    'GA' => ['en_name' => 'Gabon', 'name' => '加蓬'],
    'GB' => ['en_name' => 'United Kingdom', 'name' => '英国'],
    'GD' => ['en_name' => 'Grenada', 'name' => '格林纳达'],
    'GE' => ['en_name' => 'Georgia', 'name' => '格鲁吉亚'],
    'GF' => ['en_name' => 'French Guiana', 'name' => '法属圭亚那'],
    'GG' => ['en_name' => 'Guernsey', 'name' => '根西'],
    'GH' => ['en_name' => 'Ghana', 'name' => '加纳'],
    'GI' => ['en_name' => 'Gibraltar', 'name' => '直布罗陀'],
    'GL' => ['en_name' => 'Greenland', 'name' => '格陵兰'],
    'GM' => ['en_name' => 'Gambia', 'name' => '冈比亚'],
    'GN' => ['en_name' => 'Guinea', 'name' => '几内亚'],
    'GP' => ['en_name' => 'Guadeloupe', 'name' => '瓜德罗普'],
    'GQ' => ['en_name' => 'Equatorial Guinea', 'name' => '赤道几内亚'],
    'GR' => ['en_name' => 'Greece', 'name' => '希腊'],
    'GS' => ['en_name' => 'South Georgia and the South Sandwich Islands', 'name' => '南乔治亚和南桑威奇群岛'],
    'GT' => ['en_name' => 'Guatemala', 'name' => '危地马拉'],
    'GU' => ['en_name' => 'Guam', 'name' => '关岛'],
    'GW' => ['en_name' => 'Guinea-Bissau', 'name' => '几内亚比绍'],
    'GY' => ['en_name' => 'Guyana', 'name' => '圭亚那'],
    'HK' => ['en_name' => 'Hong Kong', 'name' => '香港'],
    'HM' => ['en_name' => 'Heard Island and McDonald Islands', 'name' => '赫德岛和麦克唐纳群岛'],
    'HN' => ['en_name' => 'Honduras', 'name' => '洪都拉斯'],
    'HR' => ['en_name' => 'Croatia', 'name' => '克罗地亚'],
    'HT' => ['en_name' => 'Haiti', 'name' => '海地'],
    'HU' => ['en_name' => 'Hungary', 'name' => '匈牙利'],
    'ID' => ['en_name' => 'Indonesia', 'name' => '印度尼西亚'],
    'IE' => ['en_name' => 'Ireland', 'name' => '爱尔兰'],
    'IL' => ['en_name' => 'Israel', 'name' => '以色列'],
    'IM' => ['en_name' => 'Isle of Man', 'name' => '马恩岛'],
    'IN' => ['en_name' => 'India', 'name' => '印度'],
    'IO' => ['en_name' => 'British Indian Ocean Territory', 'name' => '英属印度洋领地'],
    'IQ' => ['en_name' => 'Iraq', 'name' => '伊拉克'],
    'IR' => ['en_name' => 'Iran, Islamic Republic of', 'name' => '伊朗'],
    'IS' => ['en_name' => 'Iceland', 'name' => '冰岛'],
    'IT' => ['en_name' => 'Italy', 'name' => '意大利'],
    'JE' => ['en_name' => 'Jersey', 'name' => '泽西'],
    'JM' => ['en_name' => 'Jamaica', 'name' => '牙买加'],
    'JO' => ['en_name' => 'Jordan', 'name' => '约旦'],
    'JP' => ['en_name' => 'Japan', 'name' => '日本'],
    'KE' => ['en_name' => 'Kenya', 'name' => '肯尼亚'],
    'KG' => ['en_name' => 'Kyrgyzstan', 'name' => '吉尔吉斯斯坦'],
    'KH' => ['en_name' => 'Cambodia', 'name' => '柬埔寨'],
    'KI' => ['en_name' => 'Kiribati', 'name' => '基里巴斯'],
    'KM' => ['en_name' => 'Comoros', 'name' => '科摩罗'],
    'KN' => ['en_name' => 'Saint Kitts and Nevis', 'name' => '圣基茨和尼维斯'],
    'KP' => ['en_name' => 'Korea (the Democratic People\'s Republic of)', 'name' => '朝鲜'],
    'KR' => ['en_name' => 'Korea (the Republic of)', 'name' => '韩国'],
    'KW' => ['en_name' => 'Kuwait', 'name' => '科威特'],
    'KY' => ['en_name' => 'Cayman Islands', 'name' => '开曼群岛'],
    'KZ' => ['en_name' => 'Kazakhstan', 'name' => '哈萨克斯坦'],
    'LA' => ['en_name' => 'Lao People\'s Democratic Republic', 'name' => '老挝'],
    'LB' => ['en_name' => 'Lebanon', 'name' => '黎巴嫩'],
    'LC' => ['en_name' => 'Saint Lucia', 'name' => '圣卢西亚'],
    'LI' => ['en_name' => 'Liechtenstein', 'name' => '列支敦士登'],
    'LK' => ['en_name' => 'Sri Lanka', 'name' => '斯里兰卡'],
    'LR' => ['en_name' => 'Liberia', 'name' => '利比里亚'],
    'LS' => ['en_name' => 'Lesotho', 'name' => '莱索托'],
    'LT' => ['en_name' => 'Lithuania', 'name' => '立陶宛'],
    'LU' => ['en_name' => 'Luxembourg', 'name' => '卢森堡'],
    'LV' => ['en_name' => 'Latvia', 'name' => '拉脱维亚'],
    'LY' => ['en_name' => 'Libya', 'name' => '利比亚'],
    'MA' => ['en_name' => 'Morocco', 'name' => '摩洛哥'],
    'MC' => ['en_name' => 'Monaco', 'name' => '摩纳哥'],
    'MD' => ['en_name' => 'Moldova, Republic of', 'name' => '摩尔多瓦'],
    'ME' => ['en_name' => 'Montenegro', 'name' => '黑山'],
    'MF' => ['en_name' => 'Saint Martin (French part)', 'name' => '法属圣马丁'],
    'MG' => ['en_name' => 'Madagascar', 'name' => '马达加斯加'],
    'MH' => ['en_name' => 'Marshall Islands', 'name' => '马绍尔群岛'],
    'MK' => ['en_name' => 'North Macedonia', 'name' => '北马其顿'],
    'ML' => ['en_name' => 'Mali', 'name' => '马里'],
    'MM' => ['en_name' => 'Myanmar', 'name' => '缅甸'],
    'MN' => ['en_name' => 'Mongolia', 'name' => '蒙古国'],
    'MO' => ['en_name' => 'Macao', 'name' => '澳门'],
    'MP' => ['en_name' => 'Northern Mariana Islands', 'name' => '北马里亚纳群岛'],
    'MQ' => ['en_name' => 'Martinique', 'name' => '马提尼克'],
    'MR' => ['en_name' => 'Mauritania', 'name' => '毛里塔尼亚'],
    'MS' => ['en_name' => 'Montserrat', 'name' => '蒙特塞拉特'],
    'MT' => ['en_name' => 'Malta', 'name' => '马耳他'],
    'MU' => ['en_name' => 'Mauritius', 'name' => '毛里求斯'],
    'MV' => ['en_name' => 'Maldives', 'name' => '马尔代夫'],
    'MW' => ['en_name' => 'Malawi', 'name' => '马拉维'],
    'MX' => ['en_name' => 'Mexico', 'name' => '墨西哥'],
    'MY' => ['en_name' => 'Malaysia', 'name' => '马来西亚'],
    'MZ' => ['en_name' => 'Mozambique', 'name' => '莫桑比克'],
    'NA' => ['en_name' => 'Namibia', 'name' => '纳米比亚'],
    'NC' => ['en_name' => 'New Caledonia', 'name' => '新喀里多尼亚'],
    'NE' => ['en_name' => 'Niger', 'name' => '尼日尔'],
    'NF' => ['en_name' => 'Norfolk Island', 'name' => '诺福克岛'],
    'NG' => ['en_name' => 'Nigeria', 'name' => '尼日利亚'],
    'NI' => ['en_name' => 'Nicaragua', 'name' => '尼加拉瓜'],
    'NL' => ['en_name' => 'Netherlands[note 1]', 'name' => '荷兰'],
    'NO' => ['en_name' => 'Norway', 'name' => '挪威'],
    'NP' => ['en_name' => 'Nepal', 'name' => '尼泊尔'],
    'NR' => ['en_name' => 'Nauru', 'name' => '瑙鲁'],
    'NU' => ['en_name' => 'Niue', 'name' => '纽埃'],
    'NZ' => ['en_name' => 'New Zealand', 'name' => '新西兰'],
    'OM' => ['en_name' => 'Oman', 'name' => '阿曼'],
    'PA' => ['en_name' => 'Panama', 'name' => '巴拿马'],
    'PE' => ['en_name' => 'Peru', 'name' => '秘鲁'],
    'PF' => ['en_name' => 'French Polynesia', 'name' => '法属波利尼西亚'],
    'PG' => ['en_name' => 'Papua New Guinea', 'name' => '巴布亚新几内亚'],
    'PH' => ['en_name' => 'Philippines', 'name' => '菲律宾'],
    'PK' => ['en_name' => 'Pakistan', 'name' => '巴基斯坦'],
    'PL' => ['en_name' => 'Poland', 'name' => '波兰'],
    'PM' => ['en_name' => 'Saint Pierre and Miquelon', 'name' => '圣皮埃尔和密克隆'],
    'PN' => ['en_name' => 'Pitcairn', 'name' => '皮特凯恩群岛'],
    'PR' => ['en_name' => 'Puerto Rico', 'name' => '波多黎各'],
    'PS' => ['en_name' => 'Palestine, State of', 'name' => '巴勒斯坦'],
    'PT' => ['en_name' => 'Portugal', 'name' => '葡萄牙'],
    'PW' => ['en_name' => 'Palau', 'name' => '帕劳'],
    'PY' => ['en_name' => 'Paraguay', 'name' => '巴拉圭'],
    'QA' => ['en_name' => 'Qatar', 'name' => '卡塔尔'],
    'RE' => ['en_name' => 'Réunion', 'name' => '留尼汪'],
    'RO' => ['en_name' => 'Romania', 'name' => '罗马尼亚'],
    'RS' => ['en_name' => 'Serbia', 'name' => '塞尔维亚'],
    'RU' => ['en_name' => 'Russian Federation', 'name' => '俄罗斯'],
    'RW' => ['en_name' => 'Rwanda', 'name' => '卢旺达'],
    'SA' => ['en_name' => 'Saudi Arabia', 'name' => '沙特阿拉伯'],
    'SB' => ['en_name' => 'Solomon Islands', 'name' => '所罗门群岛'],
    'SC' => ['en_name' => 'Seychelles', 'name' => '塞舌尔'],
    'SD' => ['en_name' => 'Sudan', 'name' => '苏丹'],
    'SE' => ['en_name' => 'Sweden', 'name' => '瑞典'],
    'SG' => ['en_name' => 'Singapore', 'name' => '新加坡'],
    'SH' => ['en_name' => 'Saint Helena', 'name' => '圣赫勒拿'],
    'SI' => ['en_name' => 'Slovenia', 'name' => '斯洛文尼亚'],
    'SJ' => ['en_name' => 'Svalbard and Jan Mayen', 'name' => '斯瓦尔巴和扬马延'],
    'SK' => ['en_name' => 'Slovakia', 'name' => '斯洛伐克'],
    'SL' => ['en_name' => 'Sierra Leone', 'name' => '塞拉利昂'],
    'SM' => ['en_name' => 'San Marino', 'name' => '圣马力诺'],
    'SN' => ['en_name' => 'Senegal', 'name' => '塞内加尔'],
    'SO' => ['en_name' => 'Somalia', 'name' => '索马里'],
    'SR' => ['en_name' => 'Suriname', 'name' => '苏里南'],
    'SS' => ['en_name' => 'South Sudan', 'name' => '南苏丹'],
    'ST' => ['en_name' => 'Sao Tome and Principe', 'name' => '圣多美和普林西比'],
    'SV' => ['en_name' => 'El Salvador', 'name' => '萨尔瓦多'],
    'SX' => ['en_name' => 'Sint Maarten (Dutch part)', 'name' => '荷属圣马丁'],
    'SY' => ['en_name' => 'Syrian Arab Republic', 'name' => '叙利亚'],
    'SZ' => ['en_name' => 'Eswatini', 'name' => '斯威士兰'],
    'TC' => ['en_name' => 'Turks and Caicos Islands', 'name' => '特克斯和凯科斯群岛'],
    'TD' => ['en_name' => 'Chad', 'name' => '乍得'],
    'TF' => ['en_name' => 'French Southern Territories', 'name' => '法属南部和南极领地'],
    'TG' => ['en_name' => 'Togo', 'name' => '多哥'],
    'TH' => ['en_name' => 'Thailand', 'name' => '泰国'],
    'TJ' => ['en_name' => 'Tajikistan', 'name' => '塔吉克斯坦'],
    'TK' => ['en_name' => 'Tokelau', 'name' => '托克劳'],
    'TL' => ['en_name' => 'Timor-Leste', 'name' => '东帝汶'],
    'TM' => ['en_name' => 'Turkmenistan', 'name' => '土库曼斯坦'],
    'TN' => ['en_name' => 'Tunisia', 'name' => '突尼斯'],
    'TO' => ['en_name' => 'Tonga', 'name' => '汤加'],
    'TR' => ['en_name' => 'Turkey', 'name' => '土耳其'],
    'TT' => ['en_name' => 'Trinidad and Tobago', 'name' => '特立尼达和多巴哥'],
    'TV' => ['en_name' => 'Tuvalu', 'name' => '图瓦卢'],
    'TW' => ['en_name' => 'Taiwan', 'name' => '中国台湾省'],
    'TZ' => ['en_name' => 'Tanzania, United Republic of', 'name' => '坦桑尼亚'],
    'UA' => ['en_name' => 'Ukraine', 'name' => '乌克兰'],
    'UG' => ['en_name' => 'Uganda', 'name' => '乌干达'],
    'UM' => ['en_name' => 'United States Minor Outlying Islands', 'name' => '美国本土外小岛屿'],
    'US' => ['en_name' => 'United States', 'name' => '美国'],
    'UY' => ['en_name' => 'Uruguay', 'name' => '乌拉圭'],
    'UZ' => ['en_name' => 'Uzbekistan', 'name' => '乌兹别克斯坦'],
    'VA' => ['en_name' => 'Holy See (Vatican City State)', 'name' => '梵蒂冈'],
    'VC' => ['en_name' => 'Saint Vincent and the Grenadines', 'name' => '圣文森特和格林纳丁斯'],
    'VE' => ['en_name' => 'Venezuela, Bolivarian Republic of', 'name' => '委内瑞拉'],
    'VG' => ['en_name' => 'Virgin Islands, British', 'name' => '英属维尔京群岛'],
    'VI' => ['en_name' => 'Virgin Islands, U.S.', 'name' => '美属维尔京群岛'],
    'VN' => ['en_name' => 'Viet Nam', 'name' => '越南'],
    'VU' => ['en_name' => 'Vanuatu', 'name' => '瓦努阿图'],
    'WF' => ['en_name' => 'Wallis and Futuna', 'name' => '瓦利斯和富图纳'],
    'WS' => ['en_name' => 'Samoa', 'name' => '萨摩亚'],
    'YE' => ['en_name' => 'Yemen', 'name' => '也门'],
    'YT' => ['en_name' => 'Mayotte', 'name' => '马约特'],
    'ZA' => ['en_name' => 'South Africa', 'name' => '南非'],
    'ZM' => ['en_name' => 'Zambia', 'name' => '赞比亚'],
    'ZW' => ['en_name' => 'Zimbabwe', 'name' => '津巴布韦'],
];

$timezones = [
    'Africa' => [
        'Abidjan',
        'Accra',
        'Addis_Ababa',
        'Algiers',
        'Asmara',
        'Bamako',
        'Bangui',
        'Banjul',
        'Bissau',
        'Blantyre',
        'Brazzaville',
        'Bujumbura',
        'Cairo',
        'Casablanca',
        'Ceuta',
        'Conakry',
        'Dakar',
        'Dar_es_Salaam',
        'Djibouti',
        'Douala',
        'El_Aaiun',
        'Freetown',
        'Gaborone',
        'Harare',
        'Johannesburg',
        'Juba',
        'Kampala',
        'Khartoum',
        'Kigali',
        'Kinshasa',
        'Lagos',
        'Libreville',
        'Lome',
        'Luanda',
        'Lubumbashi',
        'Lusaka',
        'Malabo',
        'Maputo',
        'Maseru',
        'Mbabane',
        'Mogadishu',
        'Monrovia',
        'Nairobi',
        'Ndjamena',
        'Niamey',
        'Nouakchott',
        'Ouagadougou',
        'Porto-Novo',
        'Sao_Tome',
        'Tripoli',
        'Tunis',
        'Windhoek',
    ],
    'America' => [
        'Adak',
        'Anchorage',
        'Anguilla',
        'Antigua',
        'Araguaina',
        'Argentina/Buenos_Aires',
        'Argentina/Catamarca',
        'Argentina/Cordoba',
        'Argentina/Jujuy',
        'Argentina/La_Rioja',
        'Argentina/Mendoza',
        'Argentina/Rio_Gallegos',
        'Argentina/Salta',
        'Argentina/San_Juan',
        'Argentina/San_Luis',
        'Argentina/Tucuman',
        'Argentina/Ushuaia',
        'Aruba',
        'Asuncion',
        'Atikokan',
        'Bahia',
        'Bahia_Banderas',
        'Barbados',
        'Belem',
        'Belize',
        'Blanc-Sablon',
        'Boa_Vista',
        'Bogota',
        'Boise',
        'Cambridge_Bay',
        'Campo_Grande',
        'Cancun',
        'Caracas',
        'Cayenne',
        'Cayman',
        'Chicago',
        'Chihuahua',
        'Costa_Rica',
        'Creston',
        'Cuiaba',
        'Curacao',
        'Danmarkshavn',
        'Dawson',
        'Dawson_Creek',
        'Denver',
        'Detroit',
        'Dominica',
        'Edmonton',
        'Eirunepe',
        'El_Salvador',
        'Fort_Nelson',
        'Fortaleza',
        'Glace_Bay',
        'Goose_Bay',
        'Grand_Turk',
        'Grenada',
        'Guadeloupe',
        'Guatemala',
        'Guayaquil',
        'Guyana',
        'Halifax',
        'Havana',
        'Hermosillo',
        'Indiana/Indianapolis',
        'Indiana/Knox',
        'Indiana/Marengo',
        'Indiana/Petersburg',
        'Indiana/Tell_City',
        'Indiana/Vevay',
        'Indiana/Vincennes',
        'Indiana/Winamac',
        'Inuvik',
        'Iqaluit',
        'Jamaica',
        'Juneau',
        'Kentucky/Louisville',
        'Kentucky/Monticello',
        'Kralendijk',
        'La_Paz',
        'Lima',
        'Los_Angeles',
        'Lower_Princes',
        'Maceio',
        'Managua',
        'Manaus',
        'Marigot',
        'Martinique',
        'Matamoros',
        'Mazatlan',
        'Menominee',
        'Merida',
        'Metlakatla',
        'Mexico_City',
        'Miquelon',
        'Moncton',
        'Monterrey',
        'Montevideo',
        'Montserrat',
        'Nassau',
        'New_York',
        'Nome',
        'Noronha',
        'North_Dakota/Beulah',
        'North_Dakota/Center',
        'North_Dakota/New_Salem',
        'Ojinaga',
        'Panama',
        'Paramaribo',
        'Phoenix',
        'Port-au-Prince',
        'Port_of_Spain',
        'Porto_Velho',
        'Puerto_Rico',
        'Punta_Arenas',
        'Rankin_Inlet',
        'Recife',
        'Regina',
        'Resolute',
        'Rio_Branco',
        'Santarem',
        'Santiago',
        'Santo_Domingo',
        'Sao_Paulo',
        'Scoresbysund',
        'Sitka',
        'St_Barthelemy',
        'St_Johns',
        'St_Kitts',
        'St_Lucia',
        'St_Thomas',
        'St_Vincent',
        'Swift_Current',
        'Tegucigalpa',
        'Thule',
        'Tijuana',
        'Toronto',
        'Tortola',
        'Vancouver',
        'Whitehorse',
        'Winnipeg',
        'Yakutat',
    ],
    'Antarctica' => [
        'Casey',
        'Davis',
        'DumontDUrville',
        'Macquarie',
        'Mawson',
        'McMurdo',
        'Palmer',
        'Rothera',
        'Syowa',
        'Troll',
        'Vostok'
    ],
    'Arctic' => [
        'Longyearbyen',
    ],

    'Asia' => [
        'Aden',
        'Almaty',
        'Amman',
        'Anadyr',
        'Aqtau',
        'Aqtobe',
        'Ashgabat',
        'Atyrau',
        'Baghdad',
        'Bahrain',
        'Baku',
        'Bangkok',
        'Barnaul',
        'Beirut',
        'Bishkek',
        'Brunei',
        'Chita',
        'Colombo',
        'Damascus',
        'Dhaka',
        'Dili',
        'Dubai',
        'Dushanbe',
        'Famagusta',
        'Gaza',
        'Hebron',
        'Ho_Chi_Minh',
        'Hong_Kong',
        'Hovd',
        'Irkutsk',
        'Jakarta',
        'Jayapura',
        'Jerusalem',
        'Kabul',
        'Kamchatka',
        'Karachi',
        'Kathmandu',
        'Khandyga',
        'Kolkata',
        'Krasnoyarsk',
        'Kuala_Lumpur',
        'Kuching',
        'Kuwait',
        'Macau',
        'Magadan',
        'Makassar',
        'Manila',
        'Muscat',
        'Nicosia',
        'Novokuznetsk',
        'Novosibirsk',
        'Omsk',
        'Oral',
        'Phnom_Penh',
        'Pontianak',
        'Pyongyang',
        'Qatar',
        'Qyzylorda',
        'Riyadh',
        'Sakhalin',
        'Samarkand',
        'Seoul',
        'Shanghai',
        'Singapore',
        'Srednekolymsk',
        'Taipei',
        'Tashkent',
        'Tbilisi',
        'Tehran',
        'Thimphu',
        'Tokyo',
        'Tomsk',
        'Ulaanbaatar',
        'Urumqi',
        'Ust-Nera',
        'Vientiane',
        'Vladivostok',
        'Yakutsk',
        'Yangon',
        'Yekaterinburg',
        'Yerevan'
    ],
    'Atlantic' => [
        'Azores',
        'Bermuda',
        'Canary',
        'Cape_Verde',
        'Faroe',
        'Madeira',
        'Reykjavik',
        'South_Georgia',
        'St_Helena',
        'Stanley',
    ],
    'Australia' => [
        'Adelaide',
        'Brisbane',
        'Broken_Hill',
        'Darwin',
        'Eucla',
        'Hobart',
        'Lindeman',
        'Lord_Howe',
        'Melbourne',
        'Perth',
        'Sydney',
    ],
    'Europe' => [
        'Amsterdam',
        'Andorra',
        'Astrakhan',
        'Athens',
        'Belgrade',
        'Berlin',
        'Bratislava',
        'Brussels',
        'Bucharest',
        'Budapest',
        'Busingen',
        'Chisinau',
        'Copenhagen',
        'Dublin',
        'Gibraltar',
        'Guernsey',
        'Helsinki',
        'Isle_of_Man',
        'Istanbul',
        'Jersey',
        'Kaliningrad',
        'Kirov',
        'Lisbon',
        'Ljubljana',
        'London',
        'Luxembourg',
        'Madrid',
        'Malta',
        'Mariehamn',
        'Minsk',
        'Monaco',
        'Moscow',
        'Oslo',
        'Paris',
        'Podgorica',
        'Prague',
        'Riga',
        'Rome',
        'Samara',
        'San_Marino',
        'Sarajevo',
        'Saratov',
        'Simferopol',
        'Skopje',
        'Sofia',
        'Stockholm',
        'Tallinn',
        'Tirane',
        'Ulyanovsk',
        'Vaduz',
        'Vatican',
        'Vienna',
        'Vilnius',
        'Volgograd',
        'Warsaw',
        'Zagreb',
        'Zurich',
    ],
    'Indian' => [
        'Antananarivo',
        'Chagos',
        'Christmas',
        'Cocos',
        'Comoro',
        'Kerguelen',
        'Mahe',
        'Maldives',
        'Mauritius',
        'Mayotte',
        'Reunion',
    ],
    'Pacific' => [
        'Apia',
        'Auckland',
        'Bougainville',
        'Chatham',
        'Chuuk',
        'Easter',
        'Efate',
        'Fakaofo',
        'Fiji',
        'Funafuti',
        'Galapagos',
        'Gambier',
        'Guadalcanal',
        'Guam',
        'Honolulu',
        'Kiritimati',
        'Kosrae',
        'Kwajalein',
        'Majuro',
        'Marquesas',
        'Midway',
        'Nauru',
        'Niue',
        'Norfolk',
        'Noumea',
        'Pago_Pago',
        'Palau',
        'Pitcairn',
        'Pohnpei',
        'Port_Moresby',
        'Rarotonga',
        'Saipan',
        'Tahiti',
        'Tarawa',
        'Tongatapu',
        'Wake',
        'Wallis',
    ]
];

$tzIdMap = [
    'GMT+12' => ['UTC' => 'UTC-12', 'name' => '国际日期变更线西', 'zone' => 'Etc'],
    'GMT+11' => ['UTC' => 'UTC-11', 'name' => '协调世界时-11', 'zone' => 'Etc'],
    'Honolulu' => ['UTC' => 'UTC-10', 'name' => '夏威夷', 'zone' => 'Pacific'],
    'Anchorage' => ['UTC' => 'UTC-9', 'name' => '安克雷奇', 'zone' => 'America'],
    'Santa_Isabel' => ['UTC' => 'UTC-8', 'name' => '下加利福尼亚州', 'zone' => 'America'],
    'Los_Angeles' => ['UTC' => 'UTC-8', 'name' => '太平洋时间（美国和加拿大）', 'zone' => 'America'],
    'Chihuahua' => ['UTC' => 'UTC-7', 'name' => '奇瓦瓦,拉巴斯,马萨特兰', 'zone' => 'America'],
    'Phoenix' => ['UTC' => 'UTC-7', 'name' => '亚利桑那', 'zone' => 'America'],
    'Denver' => ['UTC' => 'UTC-7', 'name' => '山地时间（美国和加拿大）', 'zone' => 'America'],
    'Guatemala' => ['UTC' => 'UTC-6', 'name' => '中美洲', 'zone' => 'America'],
    'Chicago' => ['UTC' => 'UTC-6', 'name' => '中部时间（美国和加拿大）', 'zone' => 'America'],
    'Regina' => ['UTC' => 'UTC-6', 'name' => '萨斯喀彻温', 'zone' => 'America'],
    'Mexico_City' => ['UTC' => 'UTC-6', 'name' => '瓜达拉哈拉,墨西哥城,蒙特雷', 'zone' => 'America'],
    'Bogota' => ['UTC' => 'UTC-5', 'name' => '波哥大,利马,基多', 'zone' => 'America'],
    'Indiana/Indianapolis' => ['UTC' => 'UTC-5', 'name' => '印地安那州（东部）', 'zone' => 'America'],
    'New_York' => ['UTC' => 'UTC-5', 'name' => '东部时间（美国和加拿大）', 'zone' => 'America'],
    'Caracas' => ['UTC' => 'UTC-4:30', 'name' => '加拉加斯', 'zone' => 'America'],
    'Halifax' => ['UTC' => 'UTC-4', 'name' => '大西洋时间（加拿大）', 'zone' => 'America'],
    'Asuncion' => ['UTC' => 'UTC-4', 'name' => '亚松森', 'zone' => 'America'],
    'La_Paz' => ['UTC' => 'UTC-4', 'name' => '乔治敦,拉巴斯,马瑙斯,圣胡安', 'zone' => 'America'],
    'Cuiaba' => ['UTC' => 'UTC-4', 'name' => '库亚巴', 'zone' => 'America'],
    'Santiago' => ['UTC' => 'UTC-4', 'name' => '圣地亚哥', 'zone' => 'America'],
    'St_Johns' => ['UTC' => 'UTC-3:30', 'name' => '纽芬兰', 'zone' => 'America'],
    'Sao_Paulo' => ['UTC' => 'UTC-3', 'name' => '巴西利亚', 'zone' => 'America'],
    'Godthab' => ['UTC' => 'UTC-3', 'name' => '格陵兰', 'zone' => 'America'],
    'Cayenne' => ['UTC' => 'UTC-3', 'name' => '卡宴,福塔雷萨', 'zone' => 'America'],
    'Argentina/Buenos_Aires' => ['UTC' => 'UTC-3', 'name' => '布宜诺斯艾利斯', 'zone' => 'America'],
    'Montevideo' => ['UTC' => 'UTC-3', 'name' => '蒙得维的亚', 'zone' => 'America'],
    'GMT+2' => ['UTC' => 'UTC-2', 'name' => '协调世界时-2', 'zone' => 'Etc'],
    'Cape_Verde' => ['UTC' => 'UTC-1', 'name' => '佛得角群岛', 'zone' => 'Atlantic'],
    'Azores' => ['UTC' => 'UTC-1', 'name' => '亚速尔群岛', 'zone' => 'Atlantic'],
    'Casablanca' => ['UTC' => 'UTC', 'name' => '卡萨布兰卡', 'zone' => 'Africa'],
    'Reykjavik' => ['UTC' => 'UTC', 'name' => '蒙罗维亚,雷克雅未克', 'zone' => 'Atlantic'],
    'London' => ['UTC' => 'UTC', 'name' => '都柏林,爱丁堡,里斯本,伦敦', 'zone' => 'Europe'],
    'GMT' => ['UTC' => 'UTC', 'name' => '协调世界时', 'zone' => 'Etc'],
    'Berlin' => ['UTC' => 'UTC+1', 'name' => '阿姆斯特丹,柏林,伯尔尼,罗马,斯德哥尔摩,维也纳', 'zone' => 'Europe'],
    'Paris' => ['UTC' => 'UTC+1', 'name' => '布鲁塞尔,哥本哈根,马德里,巴黎', 'zone' => 'Europe'],
    'Lagos' => ['UTC' => 'UTC+1', 'name' => '中非西部', 'zone' => 'Africa'],
    'Budapest' => ['UTC' => 'UTC+1', 'name' => '贝尔格莱德,布拉迪斯拉发,布达佩斯,卢布尔雅那,布拉格', 'zone' => 'Europe'],
    'Warsaw' => ['UTC' => 'UTC+1', 'name' => '萨拉热窝,斯科普里,华沙,萨格勒布', 'zone' => 'Europe'],
    'Windhoek' => ['UTC' => 'UTC+1', 'name' => '温得和克', 'zone' => 'Africa'],
    'Istanbul' => ['UTC' => 'UTC+2', 'name' => '雅典,布加勒斯特,伊斯坦布尔', 'zone' => 'Europe'],
    'Kiev' => ['UTC' => 'UTC+2', 'name' => '赫尔辛基,基辅,里加,索非亚,塔林,维尔纽斯', 'zone' => 'Europe'],
    'Cairo' => ['UTC' => 'UTC+2', 'name' => '开罗', 'zone' => 'Africa'],
    'Damascus' => ['UTC' => 'UTC+2', 'name' => '大马士革', 'zone' => 'Asia'],
    'Amman' => ['UTC' => 'UTC+2', 'name' => '安曼', 'zone' => 'Asia'],
    'Johannesburg' => ['UTC' => 'UTC+2', 'name' => '哈拉雷,比勒陀利亚', 'zone' => 'Africa'],
    'Jerusalem' => ['UTC' => 'UTC+2', 'name' => '耶路撒冷', 'zone' => 'Asia'],
    'Beirut' => ['UTC' => 'UTC+2', 'name' => '贝鲁特', 'zone' => 'Asia'],
    'Baghdad' => ['UTC' => 'UTC+3', 'name' => '巴格达', 'zone' => 'Asia'],
    'Minsk' => ['UTC' => 'UTC+3', 'name' => '明斯克', 'zone' => 'Europe'],
    'Riyadh' => ['UTC' => 'UTC+3', 'name' => '利雅得', 'zone' => 'Asia'],
    'Nairobi' => ['UTC' => 'UTC+3', 'name' => '内罗毕', 'zone' => 'Africa'],
    'Tehran' => ['UTC' => 'UTC+3:30', 'name' => '德黑兰', 'zone' => 'Asia'],
    'Moscow' => ['UTC' => 'UTC+4', 'name' => '莫斯科,圣彼得堡,伏尔加格勒', 'zone' => 'Europe'],
    'Tbilisi' => ['UTC' => 'UTC+4', 'name' => '第比利斯', 'zone' => 'Asia'],
    'Yerevan' => ['UTC' => 'UTC+4', 'name' => '埃里温', 'zone' => 'Asia'],
    'Dubai' => ['UTC' => 'UTC+4', 'name' => '阿布扎比,马斯喀特', 'zone' => 'Asia'],
    'Baku' => ['UTC' => 'UTC+4', 'name' => '巴库', 'zone' => 'Asia'],
    'Mauritius' => ['UTC' => 'UTC+4', 'name' => '路易港', 'zone' => 'Indian'],
    'Kabul' => ['UTC' => 'UTC+4:30', 'name' => '喀布尔', 'zone' => 'Asia'],
    'Tashkent' => ['UTC' => 'UTC+5', 'name' => '塔什干', 'zone' => 'Asia'],
    'Karachi' => ['UTC' => 'UTC+5', 'name' => '伊斯兰堡,卡拉奇', 'zone' => 'Asia'],
    'Colombo' => ['UTC' => 'UTC+5:30', 'name' => '斯里加亚渥登普拉', 'zone' => 'Asia'],
    'Kolkata' => ['UTC' => 'UTC+5:30', 'name' => '钦奈,加尔各答,孟买,新德里', 'zone' => 'Asia'],
    'Kathmandu' => ['UTC' => 'UTC+5:45', 'name' => '加德满都', 'zone' => 'Asia'],
    'Almaty' => ['UTC' => 'UTC+6', 'name' => '阿斯塔纳', 'zone' => 'Asia'],
    'Dhaka' => ['UTC' => 'UTC+6', 'name' => '达卡', 'zone' => 'Asia'],
    'Yekaterinburg' => ['UTC' => 'UTC+6', 'name' => '叶卡捷琳堡', 'zone' => 'Asia'],
    'Yangon' => ['UTC' => 'UTC+6:30', 'name' => '仰光', 'zone' => 'Asia'],
    'Bangkok' => ['UTC' => 'UTC+7', 'name' => '曼谷,河内,雅加达', 'zone' => 'Asia'],
    'Novosibirsk' => ['UTC' => 'UTC+7', 'name' => '新西伯利亚', 'zone' => 'Asia'],
    'Krasnoyarsk' => ['UTC' => 'UTC+8', 'name' => '克拉斯诺亚尔斯克', 'zone' => 'Asia'],
    'Ulaanbaatar' => ['UTC' => 'UTC+8', 'name' => '乌兰巴托', 'zone' => 'Asia'],
    'Shanghai' => ['UTC' => 'UTC+8', 'name' => '北京,重庆,香港,乌鲁木齐', 'zone' => 'Asia'],
    'Perth' => ['UTC' => 'UTC+8', 'name' => '佩思', 'zone' => 'Australia'],
    'Singapore' => ['UTC' => 'UTC+8', 'name' => '吉隆坡,新加坡', 'zone' => 'Asia'],
    'Taipei' => ['UTC' => 'UTC+8', 'name' => '台北', 'zone' => 'Asia'],
    'Irkutsk' => ['UTC' => 'UTC+9', 'name' => '伊尔库茨克', 'zone' => 'Asia'],
    'Seoul' => ['UTC' => 'UTC+9', 'name' => '首尔', 'zone' => 'Asia'],
    'Tokyo' => ['UTC' => 'UTC+9', 'name' => '大阪,札幌,东京', 'zone' => 'Asia'],
    'Darwin' => ['UTC' => 'UTC+9:30', 'name' => '达尔文', 'zone' => 'Australia'],
    'Adelaide' => ['UTC' => 'UTC+9:30', 'name' => '阿德莱德', 'zone' => 'Australia'],
    'Hobart' => ['UTC' => 'UTC+10', 'name' => '霍巴特', 'zone' => 'Australia'],
    'Yakutsk' => ['UTC' => 'UTC+10', 'name' => '雅库茨克', 'zone' => 'Asia'],
    'Brisbane' => ['UTC' => 'UTC+10', 'name' => '布里斯班', 'zone' => 'Australia'],
    'Port_Moresby' => ['UTC' => 'UTC+10', 'name' => '关岛,莫尔兹比港', 'zone' => 'Pacific'],
    'Sydney' => ['UTC' => 'UTC+10', 'name' => '堪培拉,墨尔本,悉尼', 'zone' => 'Australia'],
    'Vladivostok' => ['UTC' => 'UTC+11', 'name' => '符拉迪沃斯托克', 'zone' => 'Asia'],
    'Guadalcanal' => ['UTC' => 'UTC+11', 'name' => '所罗门群岛,新喀里多尼亚', 'zone' => 'Pacific'],
    'GMT-12' => ['UTC' => 'UTC+12', 'name' => '协调世界时+12', 'zone' => 'Etc'],
    'Fiji' => ['UTC' => 'UTC+12', 'name' => '斐济,马绍尔群岛', 'zone' => 'Pacific'],
    'Magadan' => ['UTC' => 'UTC+12', 'name' => '马加丹', 'zone' => 'Asia'],
    'Auckland' => ['UTC' => 'UTC+12', 'name' => '奥克兰,惠灵顿', 'zone' => 'Pacific'],
    'Tongatapu' => ['UTC' => 'UTC+13', 'name' => '努库阿洛法', 'zone' => 'Pacific'],
    'Apia' => ['UTC' => 'UTC+13', 'name' => '萨摩亚群岛', 'zone' => 'Pacific'],
];

$arr = [];

foreach ($timezones as $k => $list) {
    foreach ($list as $v) {
        $tzId = sprintf('%s/%s', $k, $v);
        try {
            date_default_timezone_set($tzId);

            $dhi = date('dHi', 1704067200);
            $d = substr($dhi, 0, 2);
            $h = substr($dhi, 2, 2);
            $sMin = substr($dhi, 4, 2);

            $symbol = '+';
            $iHour = intval($h);
            if ($d === '31') {
                $symbol = '-';
            }
            $iMin = intval($sMin);

            if ($symbol === '-') {
                $iHour = 24 - $iHour;
                if ($iMin > 0) {
                    $iHour -= 1;
                }
            }

            $sHour = $iHour . '';

            if ($iMin > 0) {
                $sHour .= ':' . $sMin;
            }

            $s = $symbol . $sHour;
            if ($iHour === 0) {
                $s = '0';
            }

            $tz = new DateTimeZone($tzId);
            $tzData = $tz->getLocation();

            $name = $tzIdMap[$v]['name'] ?? '';

            $arr[$v] = array_merge(
                [
                    'UTC' => $s,
                    'time' => date('Y-m-d H:i:s', 1704067200),
                    'name' => $name
                ],
                $tzData
            );

        } catch (Exception $e) {
            var_dump($v);
        }
    }
}

$tzMap = [];

foreach ($arr as $k => $item) {
    $utc = $item['UTC'];
    if (!isset($tzMap[$utc])) {
        $tzMap[$utc] = [
            'list' => []
        ];
    }

    $countryCode = $item['country_code'];

    $tzMap[$utc]['list'][] = [
        'zoneId' => $k,
        'name' => $item['name'],
        'countryName' => $countryCodeMap[$countryCode] ?? [],
        'countryCode' => $countryCode,
        'code' => '',
    ];
}
uksort($tzMap, function ($a, $b) {
    return str_replace(':', '.', $a) - str_replace(':', '.', $b);
});
var_dump(json_encode($tzMap, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));

$text = json_encode($tzMap, JSON_UNESCAPED_UNICODE);


//$text = str_replace('"', "'", $text);
//$text = str_replace('\\', '', $text);

file_put_contents('./tz.js', 'const tzMap = ' . $text . ';');
